home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 132_01.zip / CWRITER.DOC < prev    next >
Text File  |  1993-06-01  |  3KB  |  82 lines

  1. /*
  2.     Cwriter is a graphics list processor.
  3.  
  4.     List format:
  5.             <forward pointer    >
  6.             < object number        >
  7.             < x position        >
  8.             < y position        >
  9.             < flag word        >
  10.             < object pointer    >
  11.             < x increment for movers>
  12.             < y increment for movers>
  13.             < x accumulator        >
  14.             < y accumulator        >
  15.             < list pointer 0 link    >
  16.             < count 0        >
  17.             < spare word #D        >
  18.             < spare word #E        >
  19.             < spare word #F        >
  20.  
  21.     where -    
  22.         all the above items are 16 bits.
  23.         Forward pointer is pointer to the next list block or
  24.             = NULL if the last block.
  25.         X position is from 0 to 255
  26.         Y position if from 0 to 192  both referenced to the top 
  27.             left edge of the enclosing image box
  28.         Flag word maintains the state of an object (ie,blanked).
  29.  
  30.     Objects in this list (as defined above) refer to two (or more)
  31.     lists which contain the same object information for a particular
  32.     display page. The display page lists have end at the entry
  33.             < Pointer to object table>
  34.     after the flag word which points to the actual object definition.
  35.     (see writeobj for that data structure). For a two page system,
  36.     it looks like
  37.             Master List
  38.                  /     \
  39.             /    \
  40.                /         \
  41.         Page 0 list    Page 1 list
  42.  
  43.         All interactions are with the Master list. Cwriter
  44.     takes the master list information and a start of page list
  45.     pointer and updates the page list to match the Master list.
  46.     Cwriter also outputs the updated information to the page screen.
  47.         It would be far simpler to merely erase the entire page
  48.     and rewrite it, but the time to do this function would be excessive.
  49.     Games and other graphic applications often have only a few
  50.     'movers'  with most objects 'static'. Only the 'movers' and
  51.     the objects they affect need be updated.
  52.         Cwriter takes 3 passes over the Master list and the
  53.     current page list.
  54.  
  55.        Pass 0: Flag any objects in the display list which have
  56.     moved in the master list. Update the x and y. Also, if
  57.     an object has become unblanked, flag it as a write and update
  58.     its x and y position in the display list. If an object has
  59.     become erased, flag the object as blanked and erased in the
  60.     display list and erase the object. New objects are replacements of
  61.         the object definition pointer which require an erase of the old object
  62.         and a rewrite with the new.  Objects which do no fall 
  63.     into the four catagories(new,moved,unblanked,blanked) are static
  64.     objects and are not considered in pass 0.
  65.  
  66.        Pass 1: Movers - Test for an overlap (underlap) with any 
  67.     other object in the display list. Flag such objects for write.
  68.            Blanked - Test for an overlap with any other object
  69.     in the display list and flag that object for a write.
  70.            Write   - Test for and overlap with objects which
  71.     are not already flagged for erase,write ,or blanked. If an overlap,
  72.     flag the affected object for write.
  73.  
  74.         Pass 2:    Write any object flagged for write and 
  75.     clear all flags except blanked.
  76.  
  77.     If all goes well, overlapping objects will be properly
  78.     updated and free floating statics will not be touched. Note that
  79.     all list actions are the result of Pass 0 operations.
  80.  
  81. ased in the
  82.     display list and erase the object. New obj